<% layout("/modules/cms/front/themes/"+site.theme+"/common/layout.html",{nav:'share'}){ %>
<div class="layui-main fly-marginTop">
    <div class="fly-panel">
        <div class="fly-panel-title">公共留言</div>
        <div class="fly-panel-main">
            <table class="layui-table" lay-skin="nob">
                <thead>
                <tr>
                    <th>姓名</th>
                    <th>内容</th>
                    <th>留言时间</th>
                    <th>回复人</th>
                    <th>回复内容</th>
                    <th>恢复时间</th>
                </tr>
                </thead>
                <tbody>
                <%for(guestbook in page.list){%>
                <tr>
                    <td>${guestbook.name}</td>
                    <td>${guestbook.content}</td>
                    <td>${guestbook.createDate,dateFormat="yyyy-MM-dd HH:mm:ss"}</td>
                    <td>${guestbook.reUser.name!}</td>
                    <td>${guestbook.reDate,dateFormat="yyyy-MM-dd HH:mm:ss"}</td>
                    <td>${guestbook.reContent}</td>
                </tr>
                <%}elsefor{%>
                <td colspan="6">暂时还没有人留言！</td>
                <%}%>
                </tbody>
            </table>
            <div class="pagination" style="background-color:white;margin-top: 10px;">${page}</div>
            <script type="text/javascript">
                function page(n,s){
                    location="${ctxFront}/guestbook${@Global.getUrlSuffix()}?pageNo="+n+"&pageSize="+s;
                }
            </script>
        </div>
    </div>

    <div class="fly-panel" pad20="" style="padding-top: 5px;">
        <!--<div class="fly-none">没有权限</div>-->
        <div class="layui-form layui-form-pane">
            <div class="layui-tab layui-tab-brief" lay-filter="user">
                <ul class="layui-tab-title">
                    <li class="layui-this">我要留言<!-- 编辑帖子 --></li>
                </ul>
                <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
                    <div class="layui-tab-item layui-show">
                        <form action="${ctxFront}/guestbook" method="post">
                            <div class="layui-row layui-col-space15 layui-form-item">
                                <div class="layui-col-md6">
                                    <label class="layui-form-label">留言分类</label>
                                    <div class="layui-input-block">
                                        <select lay-verify="required" name="type" lay-filter="column">
                                            <option value="">请选择</option>
                                            <%for(type in @DictUtils.getDictList('cms_guestbook')){%>
                                            <option value="${type.value}">${type.label}</option>
                                            <%}%>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-col-md6">
                                    <label class="layui-form-label" for="L_name">姓名</label>
                                    <div class="layui-input-block">
                                        <input type="text" id="L_name" lay-verify="required" name="name" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-col-md6">
                                    <label class="layui-form-label" for="L_email">邮箱</label>
                                    <div class="layui-input-block">
                                        <input type="text" id="L_email" lay-verify="required|email" name="email" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-col-md6">
                                    <label class="layui-form-label" for="L_phone">电话</label>
                                    <div class="layui-input-block">
                                        <input type="text" id="L_phone" lay-verify="required|phone" name="phone" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-col-md12">
                                    <label class="layui-form-label" for="L_workunit">单位</label>
                                    <div class="layui-input-block">
                                        <input type="text" id="L_workunit" lay-verify="required" name="workunit" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                            </div>
                            <div class="layui-form-item layui-form-text">
                                <div class="layui-input-block">
                                    <textarea id="L_content" name="content" lay-verify="required" placeholder="请输入内容" class="layui-textarea"></textarea>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label for="validateCode" class="layui-form-label">人类验证</label>
                                <#validateCode name="validateCode" inputCssStyle="layui-input;float:left;vertical-align:middle;" imageCssStyle="height:36px;width:120px;vertical-align:middle;display:inline-block;float:left;" buttonCssStyle="display:none;"/>
                            </div>
                            <div class="layui-form-item">
                                <button class="layui-btn" lay-filter="frontGuestbook" lay-submit="">立即发布</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    layui.use('form',function (form) {
        form.on('submit(frontGuestbook)', function(data){

        });
    })
</script>

<% } %>